using System;
using System.Runtime.Serialization;
using System.Security.Permissions;

namespace UserManagement.DomainEntity.Exceptions
{
    /// <summary>
    /// The exception which got thrown when system find invalid new <see cref="UserAccount"/>.
    /// </summary>
    [Serializable]
    public class NewUserAccountInvalidException : ApplicationException
    {
        public NewUserAccountInvalidException(string errorMsg, Exception innerException)
            : base(errorMsg, innerException)
        {
        }

        public NewUserAccountInvalidException(string errorMsg)
            : base(errorMsg)
        {
        }

        [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
        }
    }
}